<?php
/**
 * Created by PhpStorm.
 * User: 毛文科
 * Date: 2018\10\28 0028
 * Time: 10:03
 */
namespace app\admin\model;

use think\Model;

class Admin extends Model
{
    /**
     * @param $data
     * @return bool
     */
    public function addadmin($data)
    {
        if (empty($data) || !is_array($data)) {
            return false;
        }
        if($data['password']){
            $data['password']=md5($data['password']);
        }
        if($this ->save($data)){
            return true;
        }else{
            return false;
        }
    }
}
